package com.ternnetwork.oa.entity.work;


import com.ternnetwork.core.accesscontroll.entity.User;
import lombok.Data;

import javax.persistence.*;

@Entity
@Table(name="OA_EVENT_USER")
@Data
public class EventUser  {
    @EmbeddedId
    @AttributeOverrides( {
            @AttributeOverride(name="eventId", column=@Column(name="EVENT_ID", nullable=false) ),
            @AttributeOverride(name="userId", column=@Column(name="USER_ID", nullable=false) ) } )
    private  EventUserId id;

    @ManyToOne
    @JoinColumn(name="EVENT_ID", nullable=false, insertable=false, updatable=false)
    private Event event;
    @ManyToOne
    @JoinColumn(name="USER_ID", nullable=false, insertable=false, updatable=false)
    private User user;


}
